package page.ineffable.photostorage.mapper;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Component;
import page.ineffable.photostorage.pojo.User;

/**
 * 用户mybatis mapper
 *
 * @author lqs2
 * @date 2018/10/29, Mon
 */
@Mapper
@Component
public interface UserMapper {


    /**
     * 根据用户名和密码查询是否存在此用户
     *
     * @param username 用户名
     * @param password 密码
     * @return 用户 pojo
     **/
    @Select("select * from user where username= #{v0} and password = #{v1}")
    User hasMatchUser1(@Param("v0") String username, @Param("v1") String password);

    /**
     * 根据用户名查询是否存在此用户
     *
     * @param username 用户名
     * @return 用户 pojo
     **/
    @Select("select * from user where username= #{v0}")
    User hasMatchUser2(@Param("v0") String username);
}
